import $axios from '../utils/axios'
import URL from './url'

// 用户注册
export const register = data => {
  return $axios({
    url: URL.USER.REGISTER,
    method: 'post',
    data
  })
}

// 用户登录
export const login = data => {
  return $axios({
    url: URL.USER.LOGIN,
    method: 'post',
    data
  })
}

// 获取用户信息
export const getUserInfo = data => {
  return $axios({
    url: URL.USER.USER_INFO,
    method: 'post',
    data
  })
}

// 退出
export const logout = data => {
  return $axios({
    url: URL.USER.LOGOUT,
    method: 'post',
    data
  })
}